package top.syfy.oss.aliyun.exception;

/**
 * 自定义异常类
 *
 * @author awg
 * @date 2020/10/28 星期三
 */
public class BizException extends RuntimeException {

    private static final long serialVersionUID = -4026964256650448214L;

    /**
     * 业务错误码(不是HTTP状态码)
     */
    private String errorCode;

    /**
     * 业务错误描述信息
     */
    private String errorMsg;

    public BizException() {
        super();
    }

    public BizException(String errorCode, String errorMsg) {
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    public BizException(IBaseException base) {
        this.errorCode = base.getResultCode();
        this.errorMsg = base.getResultMsg();
    }

    public String getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }

    @Override
    public Throwable fillInStackTrace() {
        return this;
    }

}
